home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
TUTORIAL
/
1307B.ZIP
/
PROCED4.MOD
< prev
next >
Wrap
Text File
|
1989-01-18
|
2KB
|
63 lines
(* Chapter 5 - Program 4 *)
MODULE Proced4;
FROM InOut IMPORT WriteString, WriteCard, WriteLn;
VAR Count : CARDINAL;
Index : CARDINAL;
Other : CARDINAL;
PROCEDURE PrintSomeData;
VAR Count : CARDINAL;
Apple : CARDINAL;
BEGIN
Count := 7;
Other := 12;
Apple := 32;
WriteString("In PrintSomeData the variables are");
WriteCard(Index,5);
WriteCard(Count,5);
WriteCard(Other,5);
WriteCard(Apple,5);
WriteLn;
END PrintSomeData;
BEGIN (* Main program *)
FOR Index := 1 TO 3 DO
Count := Index;
Other := Index;
WriteString("In Main Program the variables are ");
WriteCard(Index,5);
WriteCard(Count,5);
WriteCard(Other,5);
WriteLn;
PrintSomeData;
WriteString("In Main Program the variables are ");
WriteCard(Index,5);
WriteCard(Count,5);
WriteCard(Other,5);
WriteLn;
WriteLn;
END; (* of FOR loop *)
END Proced4.
(* Result of execution
In Main Program the variables are 1 1 1
In PrintSomeData the variables are 1 7 12 32
In Main Program teh variables are 1 1 12
In Main Program the variables are 2 2 2
In PrintSomeData the variables are 2 7 12 32
In Main Program teh variables are 2 2 12
In Main Program the variables are 3 3 3
In PrintSomeData the variables are 3 7 12 32
In Main Program teh variables are 3 3 12
*)